#ifndef QHEXEDIT_H
#define QHEXEDIT_H

#include <QtGui>
#include "qhexedit_p.h"

class QHexEdit : public QScrollArea
{
    Q_OBJECT
    /*! Property data holds the content of QHexEdit. Call setData() to set the
    content of QHexEdit, data() returns the actual content.
    */
    Q_PROPERTY(QByteArray data READ data WRITE setData)

    /*! Property address area color sets (setAddressAreaColor()) the backgorund
    color of address areas. You can also read the color (addressaAreaColor()).
    */
    Q_PROPERTY(QColor addressAreaColor READ addressAreaColor WRITE setAddressAreaColor)

    /*! Property selection color sets (setSelectionColor()) the backgorund
    color of selected text areas. You can also read the color
    (selectionColor()).
    */
    Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor)

    /*! Set the font of the widget. Please use fixed width fonts like Mono or Courier.*/
    Q_PROPERTY(QFont font READ font WRITE setFont)


public:
    /*! Creates an instance of QHexEdit.
    \param parent Parent widget of QHexEdit.
    */
    QHexEdit(QWidget *parent = 0, const ShowableItem *items = NULL);

/*	int cursorPosition();*/
	void setData(QByteArray const &data) {qHexEdit_p->setData(data);}
	QByteArray data() const{return qHexEdit_p->data();}
	void setAddressAreaColor(QColor const &color) {qHexEdit_p->setAddressAreaColor(color);}
	QColor addressAreaColor() const {return qHexEdit_p->addressAreaColor();}
	void setSelectionColor(QColor const &color) {qHexEdit_p->setSelectionColor(color);}
	QColor selectionColor() const {return qHexEdit_p->selectionColor();}
	const QFont &font() const {return qHexEdit_p->font();}
	void setFont(const QFont &) {qHexEdit_p->setFont(font());}
	void setSelection(int begin, int end) const;
    /*! \endcond docNever */
signals:
	void mouseClicked(const int begin, const int length);
private:
    /*! \cond docNever */
    QHexEditPrivate *qHexEdit_p;
    QHBoxLayout *layout;
    QScrollArea *scrollArea;
    /*! \endcond docNever */
};

#endif

